<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>29. 重复匹配对原子组影响与电话号正则</title>
    </head>
    <body>

    </body>
    <script>
        
        // let hd='hdddhddddddjdhdhdhdhd';
        // console.log(hd.match(/(hd)+/g)) //["hd", "hd", "hdhdhdhd"]

        // let tel='010-9999999'
        // console.log(tel.match(/^\d{2,3}-\d{7,8}$/)); //["010-9999999"

        let tel = '0478-9999999'
        console.log(tel.match(/^0\d{2,3}-\d{7,8}$/)); //["0478-9999999"
    </script>
</html>
